//
//  TabBarController.m
//  WhatsChat
//
//  Created by 檀琛 on 16/3/22.
//  Copyright © 2016年 tanchen. All rights reserved.
//

#import "TabBarController.h"
#import "MessageViewController.h"
#import "ContactsTableViewController.h"
#import "FindViewController.h"
#import "MeViewController.h"


@interface TabBarController ()

@end

@implementation TabBarController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    MessageViewController *messageView = [[MessageViewController alloc]init];
    UINavigationController *messageNavigation = [[UINavigationController alloc]initWithRootViewController:messageView];
    messageNavigation.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"消息" image:[UIImage imageNamed:@"iconfont-xiaoxi.png"] tag:0];
    
    ContactsTableViewController *contactView = [[ContactsTableViewController alloc]init];
    UINavigationController *contactNavigation = [[UINavigationController alloc]initWithRootViewController:contactView];
    contactNavigation.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"通讯录" image:[UIImage imageNamed:@"iconfont-tongxunlu.png"] tag:1];
    
    FindViewController *findView = [[FindViewController alloc]init];
    UINavigationController *findNavagation = [[UINavigationController alloc]initWithRootViewController:findView];
    findNavagation.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"发现" image:[UIImage imageNamed:@"iconfont-faxian.png"] tag:2];
    
    MeViewController *meView = [[MeViewController alloc]init];
    UINavigationController *meNavigation = [[UINavigationController alloc] initWithRootViewController:meView];
    meNavigation.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"我的" image:[UIImage imageNamed:@"iconfont-wode.png"] tag:3];
    
    self.viewControllers = @[messageNavigation,contactNavigation,findNavagation,meNavigation];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
